package com.tang.commodity.controller;

import com.tang.commodity.entity.Order;
import com.tang.commodity.service.OrderService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/*
 *文件名: OrderController
 *创建者: 醉意丶千层梦
 *创建时间:2021/12/13 13:17
 *描述: 这是一个示例
 */
@RestController
public class OrderController {
    @Autowired
    private OrderService orderService;
    private static Logger logger = LogManager.getLogger(ClientController.class);

    @ResponseBody
    @RequestMapping(value = "/order/search",method = RequestMethod.POST)
    public List<Order> searchOrder(String key){
        if (key==null)
            key="";
        logger.info("search order for key : " +key);
        return orderService.searchOrder(key);
    }
}
